﻿using Basic.HrGatewayModular.Interface;
using Basic.HrRemoteModel.EmpPost.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;

namespace Basic.HrGatewayModular.Api
{
    internal class EmpPostApi : ApiController
    {
        private readonly IEmpPostService _Service;

        public EmpPostApi ( IEmpPostService service )
        {
            this._Service = service;
        }
        [ApiPower("all", "hr.emp.post.set")]
        public long Add ( EmpPostAdd datum )
        {
            return this._Service.Add(datum);
        }
        [ApiPower("all", "hr.emp.post.set")]
        public void Delete ( [NumValidate("hr.emp.post.id.error", 1)] long id )
        {
            this._Service.Delete(id);
        }

        public EmpPostData Get ( [NumValidate("hr.emp.post.id.error", 1)] long id )
        {
            return this._Service.Get(id);
        }

        public EmpPostDatum[] Gets ( [NumValidate("hr.emp.id.error", 1)] long empId, [NumValidate("hr.company.id.error", 1)] long companyId )
        {
            return this._Service.Gets(empId, companyId);
        }
    }
}
